package com.dhcc.DRGsHosp.application.impl;

import java.io.Serializable;
import java.util.Set;
import javax.inject.Named;

import org.dayatang.domain.InstanceFactory;
import org.dayatang.querychannel.QueryChannelService;
import org.springframework.transaction.annotation.Transactional;

import com.dhcc.DRGsHosp.application.SizerConditionApplication;
import com.dhcc.DRGsHosp.core.domain.SizerCondition;

@Named
@Transactional
public class SizerConditionApplicationImpl implements SizerConditionApplication,Serializable {
	private static final long serialVersionUID = 1L;
	private QueryChannelService queryChannel;

    private QueryChannelService getQueryChannelService(){
       if(queryChannel==null){
          queryChannel = InstanceFactory.getInstance(QueryChannelService.class,"queryChannel");
       }
     return queryChannel;
    }
    
	public SizerCondition findSizerCondition(String moudkeCode) {
		return SizerCondition.get(SizerCondition.class, moudkeCode);
	}
	
	
	public void creatSizerCondition(SizerCondition SizerCondition) {
		SizerCondition.save();
	}
	
	public void updateSizerCondition(SizerCondition SizerCondition) {
		SizerCondition.save();
	}
	
	public void removeSizerCondition(SizerCondition SizerCondition) {
		if(SizerCondition != null){
			SizerCondition.remove();
		}
	}
	
	public void removeSizerConditions(Set<SizerCondition> SizerConditions) {
		for (SizerCondition SizerCondition : SizerConditions) {
			SizerCondition.remove();
		}
	}
	
}
